<template>
  <div>
    <el-bread></el-bread>
    <el-button class="btn" type="primary" size="small" @click="addDialog"
      >添加</el-button
    >
    <v-list @edit="edit"></v-list>
    <v-dialog
      ref="diaInfo"
      @cancel="cancel"
      :isShow="isShow"
      :isAdd="isAdd"
    ></v-dialog>
  </div>
</template>

<script>
import vList from "../manager/list.vue";
import vDialog from "../manager/dialog.vue";
export default {
  data() {
    return {
      isShow: false,
      isAdd: true,
    };
  },
  components: {
    vList,
    vDialog,
  },
  methods: {
    addDialog() {
      (this.isShow = true), (this.isAdd = true);
    },
    cancel(e) {
      // console.log(e);
      this.isShow = e;
    },
    edit(e) {
      (this.isShow = true), (this.isAdd = false), this.$refs.diaInfo.lookup(e);
    },
  },
};
</script>

<style lang="less"scoped>
.btn {
  margin: 15px 0;
}
</style>
